<template>
	<view class="box">
		<view v-html="content"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content: '',
				id: '',
			}
		},
		onLoad(e) {
			this.id = e.id;

			if (e.type == 1) {
				uni.setNavigationBarTitle({
					title: '行李规格'
				})

				this.get_xlgg();
			}

			if (e.type == 2) {
				uni.setNavigationBarTitle({
					title: '预定须知'
				})

				this.get_ydxz();
			}
		},
		methods: {
			get_xlgg(e) {
				this.$http.get(this.$api.specification, {
					store_id: this.id
				}).then(res => {
					this.content = res.data.content_text.replace(/<img/g, '<img class="fwb_img"');
				})
			},
			get_ydxz() {
				this.$http.get(this.$api.storeDetail, {
					store_id: this.id
				}).then(res => {
					this.content = res.data.reserve.replace(/<img/g, '<img class="fwb_img"');
				})
			}
		}
	}
</script>

<style lang="less">
	.box {
		box-sizing: border-box;
		padding: 30rpx;
	}
</style>
